package Stringtest4;

import java.util.Scanner;

public class Stringtest4 {
    public static void main(String[] args) {
        //创造一个登陆界面
        Scanner input = new Scanner(System.in);
        int i =3;
        while (i>0) {
            i--;
            System.out.println("请您输入登陆账户：");
            String counter =input.next();
            System.out.println("请您输入密码");
            int passwd= input.nextInt();
            if (counter.equals("ithema")&&passwd==123456) {///比较字符串时是要用counter.equals()形式才行
                System.out.println("欢迎用户登陆系统");
                break;
            }else {
                System.out.println("密码错误请重新尝试，您还有"+i+"次机会");
            }
        }
    }
}
